{% extends 'cms/base.html' %}


{% block title %}
新闻分类
{% endblock title %}


{% block head %}
<script src="{% static 'js/news_category.min.js'%}"></script>
{% endblock head %}

{% block content-header %}
<h1>新闻分类</h1>
{% endblock content-header %}

{% block content %}
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header">
                <button class="btn btn-primary pull-right" id="add-btn">添加分类</button>
            </div>
            <div class="box-body">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>分类名称</th>
                            <th>新闻数量</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for category in categories %}
                        <tr data-pk='{{category.id}}' data-name='{{category.name}}'>
                            <th>{{category.name}}</th>
                            <th>20</th>
                            <th>
                                <button class="btn btn-warning btn-xs edit_btn">编辑</button>
                                <button class="btn btn-danger btn-xs del_btn">删除</button>
                            </th>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{% endblock content %}